using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class CacheView : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write(DateTime.Now.ToShortTimeString());
        Response.AddCacheItemDependency("Pages");
        HttpContext.Current.Cache.Add("key", "valueabc", null, DateTime.Now.AddDays(3),TimeSpan.Zero, System.Web.Caching.CacheItemPriority.High, null);
    }
    //public override string GetVaryByCustomString(HttpContext context, string custom)
    //{
    //    if (string.Compare(custom, "roles", true) == 0)
    //    {
    //        if (context.Request.IsAuthenticated)
    //        {
    //            //assumes roles are always returned in the same order, probably not true
    //            return string.Join(";", Roles.GetRolesForUser());
    //        }
    //        else
    //            return "anonymous";
    //    }

    //    return base.GetVaryByCustomString(context, custom);
    //}

}
